const MyPromise = require("./myPromise01");

function timeOut(name) {
  return new MyPromise((resolve, reject) => {
    resolve(name + "成功了");
    //reject(name + "失败了");
  });
}

timeOut("mashaodong")
  .then(
    (res) => {
      console.log(res);
      return 111;
    },
    (err) => {
      console.log(err);
      return 111;
    }
  )
  .then(
    (res) => {
      console.log(res);
    },
    (err) => {
      console.log(err);
    }
  )
  .catch((err) => {
    console.log(err);
  });
